<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>精品课程推荐</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: "Microsoft YaHei", sans-serif;
        }
        body {
            background-color: #f5f7fa;
            padding: 30px 20px;
        }
        .container {
            max-width: 1200px;
            margin: 0 auto;
        }
        h1 {
            text-align: center;
            margin-bottom: 30px;
            color: #333;
            font-size: 28px;
            font-weight: bold;
        }
        .course-grid {
            display: grid;
            grid-template-columns: repeat(5, 1fr);
            gap: 20px;
        }
        .course-card {
            background: white;
            border-radius: 8px;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
            padding: 20px;
            transition: transform 0.3s ease, box-shadow 0.3s ease;
            cursor: pointer;
        }
        .course-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
        }
        .course-title {
            font-size: 16px;
            font-weight: bold;
            color: #333;
            margin-bottom: 10px;
            line-height: 1.4;
        }
        .course-desc {
            font-size: 14px;
            color: #666;
            line-height: 1.5;
            margin-bottom: 15px;
            min-height: 40px;
        }
        .course-info {
            display: flex;
            justify-content: space-between;
            align-items: center;
            border-top: 1px solid #eee;
            padding-top: 15px;
        }
        .course-level {
            background-color: #ff6b6b;
            color: white;
            padding: 3px 8px;
            border-radius: 4px;
            font-size: 12px;
        }
        .course-learners {
            font-size: 12px;
            color: #999;
        }
        .second-row {
            margin-top: 20px;
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 20px;
            justify-content: center;
        }
        .second-row .course-card {
            grid-column: span 1;
        }
        @media (max-width: 1100px) {
            .course-grid {
                grid-template-columns: repeat(3, 1fr);
            }
            .second-row {
                grid-template-columns: repeat(2, 1fr);
            }
        }
        @media (max-width: 768px) {
            .course-grid {
                grid-template-columns: repeat(2, 1fr);
            }
            .second-row {
                grid-template-columns: 1fr;
            }
        }
    </style>
</head>
<body>
    <div class="container">
        <h1>精品推荐</h1>
        <div class="course-grid" id="firstRow">
        </div>
        <div class="second-row" id="secondRow">
        </div>
    </div>
    <script>
        const courses = [
            {
                title: "ThinkPHP5.0博客系统实战",
                desc: "新手课堂，让你更高效地掌握ThinkPHP5.0",
                level: "高级",
                learners: 1125
            },
            {
                title: "Android网络图片加载实战",
                desc: "用能子不带？我们听你学！",
                level: "高级",
                learners: 357
            },
            {
                title: "Angular2打造今日头条",
                desc: "新手课堂，主动加入，每日练就",
                level: "高级",
                learners: 22250
            },
            {
                title: "Android Hybrid App开发",
                desc: "新课程，欢迎在我们的游戏现场访问！",
                level: "高级",
                learners: 389
            },
            {
                title: "UGUI源码深度剖析",
                desc: "深入理解UGUI内部实现原理",
                level: "高级",
                learners: 124
            },
            {
                title: "Unity从入门到精通",
                desc: "实战案例教学，快速掌握Unity开发",
                level: "高级",
                learners: 888
            },
            {
                title: "Cocos深度学习实战",
                desc: "不会错过的实战课程",
                level: "高级",
                learners: 590
            },
            {
                title: "Kam12首页界面切换效果",
                desc: "实战演练界面切换技巧",
                level: "高级",
                learners: 432
            },
            {
                title: "Android APP实战项目演练",
                desc: "完整项目开发流程",
                level: "高级",
                learners: 389
            }
        ];
        function generateCourseCards() {
            const firstRow = document.getElementById('firstRow');
            const secondRow = document.getElementById('secondRow');
            for (let i = 0; i < 5; i++) {
                const course = courses[i];
                const card = document.createElement('div');
                card.className = 'course-card';
                card.innerHTML = `
                    <div class="course-title">${course.title}</div>
                    <div class="course-desc">${course.desc}</div>
                    <div class="course-info">
                        <span class="course-level">${course.level}</span>
                        <span class="course-learners">${course.learners}人在学习</span>
                    </div>
                `;
                firstRow.appendChild(card);
            }
            for (let i = 5; i < 9; i++) {
                const course = courses[i];
                const card = document.createElement('div');
                card.className = 'course-card';
                card.innerHTML = `
                    <div class="course-title">${course.title}</div>
                    <div class="course-desc">${course.desc}</div>
                    <div class="course-info">
                        <span class="course-level">${course.level}</span>
                        <span class="course-learners">${course.learners}人在学习</span>
                    </div>
                `;
                secondRow.appendChild(card);
            }
        }
        window.onload = generateCourseCards;
    </script>
</body>
</html>